package model

type CommonResult struct {
	Code    int
	Success bool
	Message string
	Data    interface{}
}

func ReturnSuccess(data interface{}) *CommonResult {

	return &CommonResult{
		Code:    200,
		Success: true,
		Data:    data,
	}
}

func ReturnFail(err error) *CommonResult {
	return &CommonResult{
		Code:    500,
		Success: false,
		Message: err.Error(),
	}
}

